/* 
 * Header file for Sphere
 * Programming by SochiX (http://sochix.ru)
 */

#ifndef _SPHERE_HPP
#define _SPHERE_HPP

#include "rt_object.hpp"
#include "vector3D.hpp"
#include "point3D.hpp"
#include "../def.hpp"
#include "../graph/color.hpp"
#include <math.h>


class Sphere: public RTobject
{
	private:
	Vector3D normalVect;
	public:
	int radius;
	int radius2; //squared radius
		
	Sphere(Point3D nposition, Material nMat, int nradius): RTobject(nposition, nMat),radius(nradius) {radius2=radius*radius;}
   	virtual bool Intersect(Ray& intersectRay, double&);
	virtual Color Trace(Ray& viewRay,Point3D lightPos, double& dist);
	virtual Vector3D GetNormalVect();
};

#endif	/* _SPHERE_HPP */
